/**
 * @file ndt_registration.hpp
 * @author ysh
 * @brief NDT 匹配模块
 * @version 0.1
 * @date 2023-05-10
 * 
 * @copyright Copyright (c) 2023
 * 
 */
#ifndef MODELS_REGISTRATION_NDT_REGISTRATION_HPP_
#define MODELS_REGISTRATION_NDT_REGISTRATION_HPP_

#include <pcl/registration/ndt.h>
#include "registration_interface.hpp"


class NDTRegistration: public RegistrationInterface {
  public:
    //从配置文件中读取NDT参数
    NDTRegistration(const YAML::Node& node);
    //代码中定义NDT数据
    NDTRegistration(float res, float step_size, float trans_eps, int max_iter);

    bool SetInputTarget(const CloudData::CLOUD_PTR& input_target) override;
    bool ScanMatch(const CloudData::CLOUD_PTR& input_source, 
                   const Eigen::Matrix4f& predict_pose, 
                   CloudData::CLOUD_PTR& result_cloud_ptr,
                   Eigen::Matrix4f& result_pose) override;
 
  private:
    bool SetRegistrationParam(float res, float step_size, float trans_eps, int max_iter);

  private:
    pcl::NormalDistributionsTransform<CloudData::POINT, CloudData::POINT>::Ptr ndt_ptr_;
};


#endif